use std::sync::{mpmc::Sender, Arc, Barrier};

use crate::mpmc_scheduler::MpmcTaskScheduler;

pub enum ProcessControlTask<T> {
    Task(T),
    Break(Arc<Barrier>),
}

pub trait MpmcTaskAttr: Send + Sync + std::fmt::Debug + Clone + 'static  {
    type SenderGroup:Sized + std::fmt::Debug + Clone + Send + Sync + 'static;
    fn predefine_sender(sched:&mut MpmcTaskScheduler<Self>);
    fn group_send(sender_group:&Self::SenderGroup, process_control_task:ProcessControlTask<Self>);
    fn get_sender_group_from(sched:&MpmcTaskScheduler<Self>) -> Result<Self::SenderGroup, String>;
    fn send_init_task(sched:&MpmcTaskScheduler<Self>, init_task:Self);
    fn get_exec_terminal_sender(sender_group:&Self::SenderGroup) -> Sender<()>;
}